<?php

namespace app\common\model\meet;

use think\Model;


class CouponTemplate extends Model
{


    // 表名
    protected $name = 'meet_coupon_template';

    // 自动写入时间戳字段
    protected $autoWriteTimestamp = 'integer';

    // 定义时间戳字段名
    protected $createTime = 'createtime';
    protected $updateTime = 'updatetime';
    protected $deleteTime = false;

    // 追加属性
    protected $append = [];

    const STATUS_HIDDEN = 'hidden';

    const STATUS_NORMAL = 'normal';

    const VALIDITY_TYPE_TIME = 0;

    const VALIDITY_TYPE_DAYS = 1;

    const AVAILABLE_TYPE_ALL = 'all';

    const AVAILABLE_TYPE_MALL = 'mall';

    const AVAILABLE_TYPE_RESERVATION = 'reservation';

    const RANGE_TYPE_ALL = 'all';

    const RANGE_TYPE_APPOINT = 'appoint';

    public function getMoneyAttr($value)
    {
        return $value ? (float)$value : 0;
    }

    public function getLimitAttr($value)
    {
        return $value ? (float)$value : 0;
    }
}
